package behavior.state.versionOne;

import behavior.state.enums.TimeQuantum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * @author huhaiqiang
 * @version V1.0
 * @description Person
 * @date 2018/12/21 09:15
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Slf4j
public class Person {

    private int hourOne;

    /**
     * 时间段，靠这个字段的变化来定义什么时间做什么事
     */
    private int hour;

    public void doSth() {

        if (this.hour == TimeQuantum.HOUR_ONE.getHour()) {
            log.info("现在是早上8点，上早班啦！");
        } else if (this.hour == TimeQuantum.HOUR_TWO.getHour()) {
            log.info("现在是中午12点，下班吃午饭啦！");
        } else if (this.hour == TimeQuantum.HOUR_THREE.getHour()) {
            log.info("现在是下午14点，上中班啦！");
        } else if (this.hour == TimeQuantum.HOUR_FOUR.getHour()) {
            log.info("现在是傍晚18点，下班回家啦！");
        } else if (this.hour == TimeQuantum.HOUR_FIVE.getHour()) {
            log.info("现在是晚上23点，上床睡觉啦！");
        } else if (this.hour > TimeQuantum.HOUR_FOUR.getHour() && this.hour < TimeQuantum.HOUR_FIVE.getHour()) {
            log.info("加班中...");
        } else if (this.hour > TimeQuantum.HOUR_FIVE.getHour() || this.hour < TimeQuantum.HOUR_ONE.getHour()) {
            log.info("正在睡觉...");
        } else {
            log.info("现在是上班时间！");
        }
    }
}
